<template>
	<view style="padding: 20rpx;">
		<rich-text :nodes="nodes"></rich-text>
	</view>
</template>

<script>
	import {getBankList,getBankAgree,getBaofuAgree} from '@/api/bank'
	import {getCreditor,getCreditorTell,getAgreement,getPersonAgreement,getUserAgreement,getCert,getPrivacy} from '@/api/argee'
	export default {
		data() {
			return {
				nodes:''
			}
		},
		onLoad(options){
			console.log(options);
			if(options.userId){
				const argeeList={
					'0':()=>{getAgreement().then(res=>{ this.nodes=res.content })},
					'1':()=>{getPrivacy().then(res=>{ this.nodes=res.content })},
					'2':()=>{getPersonAgreement().then(res=>{ this.nodes=res.content })},
					'3':()=>{getCreditor().then(res=>{ this.nodes=res.content })},
					'4':()=>{getCreditorTell().then(res=>{ this.nodes=res.content })},
					'5':()=>{getUserAgreement().then(res=>{ this.nodes=res.content })},
					'6':()=>{getCert().then(res=>{ this.nodes=res.content })},
				}
				argeeList[options.userId]?argeeList[options.userId]():console.log('暂无协议');
			}else{
				if(options.id==0){
					getBaofuAgree().then(res=>{
						this.nodes=res.content
					})
				}else{
					getBankAgree(options.id).then(res=>{
						this.nodes=res[0].content
					})
				}
			}
			
			
		},
		methods: {
			getArgee(){
				
			}
		}
	}
</script>

<style>

</style>
